from rest_framework import serializers

from health import models


class FirstSerializer(serializers.ModelSerializer):
    class Meta:
        model = models.Health
        fields = ['id', 'name']


class SecondSerializer(serializers.ModelSerializer):
    son = FirstSerializer(many=True)

    class Meta:
        model = models.Health
        fields = ['id', 'name', 'son']


class HealthSerializer(serializers.ModelSerializer):
    son = SecondSerializer(many=True)

    class Meta:
        model = models.Health
        fields = ['id', 'name', 'son']
